﻿<%@ Page Language="VB" AutoEventWireup="true" CodeFile="changeuser.aspx.vb" Inherits="MovieTixStaff_changeuser" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  Private Sub Page_Load(sender As Object, e As MenuEventArgs)

End Sub

</script>
<%--This below code from the website:http://ramanisandeep.wordpress.com/2008/11/07/hide-an-aspnet-label-control-after-a-few-seconds/--%>

<script type="text/javascript">
    self.setInterval("changeValue1()", 4900);

    function changeValue1() {
        document.getElementById("Label8").innerText = "";

    }
 
</script>
<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
<style type="text/css">
    html
    {
        background-color:Black;
        color:White;
    }
    .center
    {
 margin-left:150px;

    }
</style>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
   <asp:Label ID="Label8" runat="server" ForeColor="#FFFFCC" Font-Size="Large"></asp:Label><br />

            <asp:Label ID="Label1" runat="server" Text="Please select a staff name and theatre name you want to move the staff to:" Font-Bold="True" Font-Size="Larger" ForeColor="#CCFFFF"></asp:Label> <br />
<br />
          <table>
<tr><td><asp:Label ID="Label6" runat="server" Text="Please select a theatre staff:" Font-Bold="True"></asp:Label> </td> 
<td> <asp:DropDownList id="DropDownList1"   DataSourceID="SqlDataSource2" DataTextField="TheatreStaffUserName" DataValueField="TheatreStaffUserName" runat="server">
</asp:DropDownList>  
       
 <asp:SqlDataSource id="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                SelectCommand="SELECT [TheatreStaffUserName] FROM [TheatreStaff]"></asp:SqlDataSource>   </td></tr>      
          
  <tr><td><asp:Label ID="Label7" runat="server" Text="Move to the theatre:" Font-Bold="True"></asp:Label> </td> 
<td> <asp:DropDownList id="DropDownList2"   DataSourceID="SqlDataSource3" DataTextField="TheatreName" DataValueField="TheatreId" runat="server" ></asp:DropDownList>
  
       
 <asp:SqlDataSource id="SqlDataSource3" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                
        SelectCommand="SELECT DISTINCT [TheatreId], [TheatreName] FROM [Theatre]"></asp:SqlDataSource>   </td></tr>              
 
  </table>
             
 
  <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
  ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 

 UpdateCommand="UPDATE [TheatreStaff] SET [TheatreId] = @TheatreId WHERE [TheatreStaffUserName] = @TheatreStaffUserName" >

 <UpdateParameters>
              
 <asp:Parameter Name="TheatreId" Type="Int16"  />
  <asp:ControlParameter Name="TheatreStaffUserName" ControlID="DropDownList1"  PropertyName="SelectedValue" />       
 </UpdateParameters>
         

 </asp:SqlDataSource>
          <br />
  <asp:Button ID="Button1" CssClass="center" OnClick="update"  runat="server" Text="Update" />
   
   </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>